package com.tjc.cloud.util.signature
import java.util.*
fun ByteArray.base64EncodeBytes(): ByteArray = Base64.getEncoder().encode(this)
fun ByteArray.base64Encode() = String(this.base64EncodeBytes())
fun ByteArray.base64DecodeBytes(): ByteArray = Base64.getDecoder().decode(this)
fun ByteArray.base64Decode() = String(this.base64DecodeBytes())



fun String.base64Encode() = String(this.base64EncodeBytes())
fun String.base64EncodeBytes(): ByteArray =this.toByteArray().base64EncodeBytes()

fun String.base64Decode() = String(this.base64DecodeBytes())
fun String.base64DecodeBytes()=this.substring(0,this.length/4*4).toByteArray().base64DecodeBytes()